package service.impl;

import dao.UserDao;
import service.UserService;

import java.util.List;
import java.util.Map;

/**
 * @author 石小俊
 */
public class UserServiceImpl implements UserService {

    //    private UserDao userDao = new UserDaoImpl();
//    private UserDao userDao = (UserDao) ObjectFactory.getObject();
    private UserDao userDao;
    private String name;
    private List<Integer> list;
    private Map<String, String> map;

    public void setName(String name) {
        this.name = name;
    }

    public void setList(List<Integer> list) {
        this.list = list;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public void register() {
        userDao.insertUser();
    }

    @Override
    public void login() {
        userDao.selectByUsernameAndPassword();
        System.out.println("name:" + name + ",list:" + list + ",map:" + map);
    }
}
